<template>
	<!-- 预览文件页面 -->
  <view>
	  <view class="flex benben-position-layout flex flex-wrap align-center privacy_flex_0"
	  	:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }"
	  	style="margin-left: -10px;width: 100%;">
	  	<view class='flex flex-wrap align-center justify-between flex-sub privacy_fd0_0'>
	  		<view class='flex flex-wrap align-center privacy_fd0_0_c0' @tap.stop="handleJumpDiy"
	  			data-type="back" data-url="1">
	  			<text class='fu-iconfont2  privacy_fd0_0_c0_c0'>&#xE794;</text>
	  		</view>
	  		<view class='flex flex-wrap align-stretch justify-center'>
	  			<text class='privacy_fd0_0_c1_c0'>资源详情</text>
	  		</view>
	  		<view class='flex flex-wrap align-center justify-end privacy_fd0_0_c0'>
	  		</view>
	  	</view>
	  </view>
	  <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
    <!-- <web-view :src="pdfViewUrl"></web-view> -->
	<view class="" style="text-align: center;width: 100%;">
		<image  v-for="(item,index) in list" :key='index' style="width: 750rpx;"  :src="item"  @tap.stop="multiImagePreview(item,list,'')" mode="widthFix"></image>
	</view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      pdfViewUrl: '',
	  id:'',
	  list:[]
    }
  },
  onLoad(options) {
	  // this.pdfViewUrl = uni.getStorageSync('browseFiles');
	  this.id=options.id
	  this.getinfo()
	   // console.log(pdfUrl)
   //  if (pdfUrl) {
     
      
   //    // 多种预览方案
   //    const previewMethods = [
   //      // 方法1: 直接打开（简单但兼容性差）
   //      pdfUrl,
        
   //      // 方法2: 使用 Google Docs 预览
   //      `https://docs.google.com/gview?embedded=true&url=${encodeURIComponent(pdfUrl)}`,
        
   //      // 方法3: 使用微软 Office Online 预览
   //      `https://view.officeapps.live.com/op/view.aspx?src=${encodeURIComponent(pdfUrl)}`,
        
   //      // 方法4: 使用 PDF.js（需要部署）
   //      `https://mozilla.github.io/pdf.js/web/viewer.html?file=${encodeURIComponent(pdfUrl)}`
   //    ];
      
   //    // 使用第一个方案
   //    this.pdfViewUrl = previewMethods[1];
	  // console.log(this.pdfViewUrl)
   //  }
  },
  methods:{
	  async getinfo(id){
			let res = await this.$api.post(global.apiUrls.post68dccdc5a9298, {
				resource_id:id
			});
			// this.isup = true
			if (res.data.code != 1) {
				this.$message.info(res.data.msg);
				return
			}
			console.log(res.data.data)
			this.list=[]
			res.data.data.map(item=>{
				this.list.push(item.img_url)
			})
		}
  }
}
</script>
<style lang="scss" scoped>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: #Fff;
		background-size: 100% auto;
	}

	.privacy_flex_0 {
		background: #fff;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.privacy_fd0_0_c1_c0 {
		font-size: 36rpx;
		font-weight: 700;
		color: #333333;
		line-height: 50rpx;
	}

	.privacy_fd0_0_c0_c0 {
		font-size: 36rpx;
		color: #333;
	}

	.privacy_fd0_0_c0 {
		width: 120rpx;
	}

	.privacy_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
	}

	.privacy_flex_1 {
		padding: 24rpx;
	}

	::v-deep .privacy_fd1_0 {
		width: 100%;
	}
</style>

